#include "placeinfowid.h"
#include <QVBoxLayout>
#include <QFont>

PlaceInfoWid::PlaceInfoWid(QWidget *parent) : QWidget(parent)
{
    this->setWindowTitle("地点信息简介");
    QVBoxLayout *vlayout = new QVBoxLayout(this);
    this->nameLab = new QLabel(this);
    this->descLab = new QLabel();
    vlayout->addWidget(nameLab);
    vlayout->addWidget(descLab);
    resize(400,300);
    this->descLab->adjustSize();
    this->descLab->setGeometry(QRect(328, 240, 329, 27*4));  //四倍行距
    QFont font("楷体",16);
    QFont fontDesc("楷体",12);
    this->descLab->setWordWrap(true);
    this->descLab->setAlignment(Qt::AlignTop);
    this->descLab->setFont(fontDesc);
    this->nameLab->setMaximumHeight(height()*0.2);
    this->nameLab->setAlignment(Qt::AlignCenter);
    this->nameLab->setFont(font);
}

void PlaceInfoWid::setName(char *name)
{
    this->nameLab->setText(QString(name));
}

void PlaceInfoWid::setDesc(char *desc)
{
    this->descLab->setText(desc);
}

